import Vue from 'vue';
import VueRouter from 'vue-router';
// import Dewu from '../views/Dewu.vue';



Vue.use(VueRouter)


const routes = [

    {
        path: '/',  //path就是配置url路径
        // name: '/Dewu', //name就是给当前规则起个名字
        redirect: '/Dewu' //路由重定向

        // component: () => import('../views/Dewu.vue') //设置引用1的组件
        // // 这里使用路由懒加载
    },
    {
        // 这里是个登录页面，注册没接口实现不了
        path: '/DL',
        name: 'DL',
        component: () => import('../views/DL.vue')

    },
    {
        
        path: '/Zc',
        name: 'Zc',
        component: () => import('../views/Zc.vue')

    },
    {
        path: '/Dewu',
        name: 'Dewu',
        component: () => import('../views/Dewu.vue'),
        children: [
            {
                path: '/',
                redirect: '/Guanzhu'
                // 这里加个重定向
            },
            {
                path: '/Guanzhu',
                name: 'Guanzhu',
                component: () => import('../components/Guanzhu.vue')
            },
            {
                path: '/Tuijian',
                name: 'Tuijian',
                component: () => import('../components/Tuijian.vue')
            },
            {
                path: '/Zhibo',
                name: 'Zhibo',
                component: () => import('../components/Zhibo.vue')
            },
            
        ]

    },
    {
        path: '/Myself',
        name: 'Myself',
        component: () => import('../views/Myself.vue')

    },
    {
        path: '/SZym',
        name: 'SZym',
        component: () => import('../views/SZym.vue')
    },

    {
        path: '/Service',
        name: 'Service',
        component: () => import('../views//Service.vue')

    },
    {
        path: '/Shopping',
        name: 'Shopping',
        component: () => import('../views/Shopping.vue')

    },
    {
        path: '/GouM',
        name: 'GouM',
        component: () => import('../views/GouM.vue')

    },
    {
        path: '/SouS',
        name: 'SouS',
        component: () => import('../views/SouS.vue')

    },
    {
        path: '/Xqing',
        name: 'Xqing',
        component: () => import('../views/Xqing.vue')

    },
    {
        path: '/Carshopping',
        name: 'Carshopping',
        component: () => import('../views/Carshopping.vue')

    },

   // 404的写法
   {
    path: '*',
    name: 'S404',
    component: () => import('../views/404.vue')
  }



]
// 创建路由对象
const router = new VueRouter({
    mode: 'hash', 
    //设置路由模式,不写的话就是hash
    base: process.env.BASE_URL,
    routes
})
//   这里需要暴露
export default router
